
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
  <div class="layui-form-item">
    <label class="layui-form-label">用户昵称</label>
    <div class="layui-input-inline" style="width: 450px;">
      <script type="text/html" template>
        <input type="text" name="nickname" value="{{ d.params.nickname || '沛霖主页' }}" lay-verify="required" placeholder="用户昵称" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">用户邮箱</label>
    <div class="layui-input-inline" style="width: 450px;">
      <script type="text/html" template>
        <input type="text" name="mail" value="{{ d.params.mail || 'jack.liu@anyue.net' }}" lay-verify="required" placeholder="jack.liu@ailcc.com" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item mess-fenlei" id="mess-fenlei">
    <label class="layui-form-label">文章评论</label>
    <div class="layui-input-inline">
      <script type="text/html" template lay-url="/api/messages/getCategoryList" lay-done="layui.form.render('select');"
        lay-data="{'lang': layui.data('lang').lang}">
        <select name="pid" id="pid" >
             <option value="0">留言板发布</option>
              {{# layui.each(d.data,function(index,item){ }}
                <option value="{{ item.id }}" {{ item.title === d.params.pidions ? 'selected' : '0' }}>{{ item.title }}</option>
              {{# }); }}
        </select>
       </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">博客地址</label>
    <div class="layui-input-inline" style="width: 450px;">
      <script type="text/html" template>
        <input type="text" name="url_s" value="{{ d.params.url_s || 'https://ailcc.com' }}" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">留言内容</label>
    <div class="layui-input-inline" style="width: 450px;">
      <script type="text/html" template>
        <textarea name="content" lay-verify="required" style="width: 600px; height: 120px;" autocomplete="off" class="layui-textarea">{{ d.params.content || '' }}</textarea>
      </script>
    </div>
  </div>
  <div class="layui-form-item" >
    <label class="layui-form-label">状态</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="checkbox" lay-filter="status" name="status" lay-skin="switch" lay-text="显示|隐藏" {{ d.params.status === 1 ? 'checked' : '' }} >
      </script> 
    </div>
  </div>

  <script type="text/html" template>
    <input type="hidden" name="id" value="{{ d.params.id || '' }}">
  </script>

  <script type="text/html" template>
    <input type="hidden" name="lang" value="{{ layui.data('lang').lang }}">
  </script>

  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>
<script>
layui.use(['admin', 'form', 'upload'], function(){
  var $ = layui.$
  ,form = layui.form
  ,upload = layui.upload;
      var laydate = layui.laydate;

  //上传头像
  upload.render({
    elem: '#layuiadmin-upload-useradmin'
    ,url: '/api/report/upload'
    ,accept: 'images'
    ,method: 'get'
    ,acceptMime: 'image/*'
    ,done: function(res){
      $(this.item).prev("div").children("input").val(res.data.src)
    }
  });

  form.on('radio(status)', function(data){
    // console.log(data.elem); //得到radio原始DOM对象
    console.log(data.value); //被点击的radio的value值
  });  

})
</script>